home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 41 / 041.d81 / pixel puzzler (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  271 lines

  1. 10 ifx>.then100
  2. 15 poke55,119:poke56,55:clr
  3. 20 poke53280,1:poke53281,1
  4. 30 printchr$(142)"[147] gathering the pieces to the puzzle..."
  5. 100 ifx=0thenx=1:load"text.3.1.o",8,1
  6. 120 ifx=1thenx=2:load"space.lnk",8,1
  7. 130 ifx=2thenx=3:load"unpacker",8,1
  8. 140 ifx=3thenx=4:load"hand.spr",8,1
  9. 145 ifx=4thenx=5:load"copymem2.o",8,1
  10. 146 ifx=5thenx=6:load"puzzle.fnt",8,1
  11. 150 :
  12. 160 ni=42 : rem number of items 6*7
  13. 170 na=6  : rem number across
  14. 180 nd=6  : rem number down-1
  15. 182 v=53248:rem vic
  16. 183 te=49161:rem hi-res text printer
  17. 184 cm=14200:rem copy memory
  18. 185 dim a%(ni):mo=1
  19. 189 :
  20. 190 se$(1)=" [215]inner........[[211]ee [208]icture] "
  21. 191 se$(2)=" [201]ntermediate..[[208]lace '[197]m]   "
  22. 192 se$(3)=" [204]oser.........[[211]lide '[197]m]   "
  23. 193 se$(4)=" [209]uit..........[[194]ye [194]ye]     "
  24. 194 sp$="                               "
  25. 220 poke53281,14:poke53280,14:print"[147]":mo=1:se$=""
  26. 235 pokev+21,0:poke53270,peek(53270)and255-16
  27. 240 print"           [204][207][193][196][211][212][193][210] [208]resents:"
  28. 242 print"             [208][201][216][197][204] [208][213][218][218][204][197][210]"
  29. 244 print"    [194]y [193]lan [199]ardner and [205]ike [205]aynard"
  30. 246 print"            -- [205][193][201][206] [205][197][206][213] --"
  31. 247 print"   [195][210][211][210] keys scroll -- [210][197][212][213][210][206] selects"
  32. 248 printse$;:fora=1to4:printse$(a)" "chr$(13)sp$:next
  33. 250 printse$""se$(mo)"[146][187]"
  34. 252 print"[188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]":poke198,.
  35. 280 geta$:gosub9000:ifa$=""then280
  36. 282 ifa$=chr$(13)then330
  37. 284 ifa$=""andmo<4thenmm=1:goto290
  38. 286 ifa$="[145]"andmo>1thenmm=-1:goto290
  39. 288 goto280
  40. 290 printse$""se$(mo)" "chr$(13)sp$
  41. 292 ifmm=1thense$=se$+""
  42. 294 ifmm=-1thense$=left$(se$,len(se$)-2)
  43. 296 mo=mo+mm:goto250
  44. 330 ifmo=4then1020
  45. 340 ifmo=1thenforx=1toni:a%(x)=x:next:cf=1:gosub7000:gosub6000:gosub7100:goto510
  46. 350 gosub 1680
  47. 355 sm=1:gosub 4000 : rem show picture
  48. 360 :
  49. 370 gosub5000
  50. 380 :
  51. 390 :
  52. 400 :
  53. 410 cf=0
  54. 420 poke1016+52224,24:pokev+39,5:pokev,60:pokev+1,68
  55. 430 pokev+29,0:pokev+23,0:pokev+16,0
  56. 450 :
  57. 460 ifgip=1then510
  58. 470 forx=1toni:a%(x)=x:next
  59. 480 forx=1toni:r1=rnd(1)*ni+1:r2=rnd(1)*ni+1:t=a%(r1):a%(r1)=a%(r2)
  60. 490 a%(r2)=t:next
  61. 495 ro=0:co=1
  62. 500 :
  63. 510 gosub 3300 : rem plot them puppies
  64. 600 :
  65. 610 fl=0
  66. 620 forx=0toni-1
  67. 630 ifa%(x+1)<>x+1thenfl=1
  68. 640 ifa%(x+1)=nithenbl=x
  69. 650 next
  70. 660 :
  71. 670 ifcf=1then1530
  72. 680 iffl=0thensys49161,"               [217][207][213] [215][207][206]!!             ",1,0,0:goto1450
  73. 690 j=56320
  74. 700 pokev+21,1:gosub 1080:pokev+21,.:ifmathenma=.:goto510
  75. 710 a=co+ro*na
  76. 720 br=int(bl/na):bc=bl-na*br:bc=bc+1
  77. 730 ifmo=2anda%(a)<>nithen1600 : rem plop it
  78. 740 if(br<>roandbc<>co)ora%(a)=nithen970
  79. 750 ifbr<>rothen870
  80. 760 if bc>cothenb=bc:e=co+1:i=-1
  81. 770 if bc<cothenb=bc:e=co-1:i=1
  82. 780 forx=btoestepi
  83. 790 t=ro*na+x:f=ro*na+x+i
  84. 800 a%(t)=a%(f)
  85. 810 poke254,2+ro*3:poke253,x*5:poke255,a%(t)-1:sys51462
  86. 820 poke254,2+ro*3:poke253,(x+i)*5:poke255,ni-1:sys51462
  87. 830 next
  88. 840 ag=3.34:a%(ro*na+x)=ni
  89. 850 goto 610
  90. 860 :
  91. 870 ifbc<>cothen960
  92. 880 ifbr>rothenb=br:e=ro+1:i=-1
  93. 890 ifbr<rothenb=br:e=ro-1:i=1
  94. 900 forx=btoestepi
  95. 910 t=x*na+co:f=(x+i)*na+co:a%(t)=a%(f)
  96. 920 poke253,co*5:poke254,2+x*3:poke255,a%(t)-1:sys51462
  97. 930 poke253,co*5:poke254,2+(x+i)*3:poke255,ni-1:sys51462
  98. 940 ag=3.34:next
  99. 950 a%(x*na+co)=ni:goto610
  100. 960 :
  101. 970 sys49161,"            [201][204][204][197][199][193][204] [205][207][214][197]            ",1,0,0:sys49167,1000,33,15,15
  102. 980 fordl=1to500:next:sys49167,0,32,0,0
  103. 990 sys49161,"            ",13,0,0
  104. 1000 goto 700
  105. 1010 :
  106. 1020 pokev+21,0:pokev+16,0:print"[147]"
  107. 1030 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  108. 1040 ifer<>63thenpoke198,.:end
  109. 1050 load"hello connect",8
  110. 1060 end
  111. 1070 :
  112. 1080 rem read keyboard and joystick
  113. 1090 ifpeek(198)=0andpeek(j)=127thenpokev+39,(peek(v+39)and15)+1:goto1090
  114. 1100 geta$:js=peek(j):ifjs=111ora$=chr$(13)thenreturn
  115. 1110 cf=0:ifa$="w"thenforx=1toni:a%(x)=x:next:cf=1:ma=1:return
  116. 1115 ifa$="h"thenpokev+21,.:gosub3000:pokev+21,1:gosub5000:goto1090
  117. 1120 ifa$="m"thengosub1320:goto1090
  118. 1130 ifa$="s"thengosub1980:goto1090
  119. 1135 ifa$="v"thenpokev+21,.:gosub4000:gosub5000:pokev+21,1:goto1090
  120. 1137 pokev+39,(peek(v+39)and15)+1
  121. 1140 ifa$=""orjs=119thenco=co+1
  122. 1150 ifa$="[157]"orjs=123thenco=co-1
  123. 1160 ifa$=""orjs=125thenro=ro+1
  124. 1170 ifa$="[145]"orjs=126thenro=ro-1
  125. 1180 ifjs=118thenco=co+1:ro=ro-1
  126. 1190 ifjs=117thenco=co+1:ro=ro+1
  127. 1200 ifjs=121thenco=co-1:ro=ro+1
  128. 1210 ifjs=122thenco=co-1:ro=ro-1
  129. 1220 :
  130. 1230 ifco<1thenco=1
  131. 1240 ifro<0thenro=0
  132. 1250 ifro>ndthenro=nd
  133. 1260 ifco>nathenco=na
  134. 1270 :
  135. 1280 pokev,21+co*39:pokev+1,68+ro*24:pokev+16,0
  136. 1290 goto1090
  137. 1300 :
  138. 1310 :
  139. 1320 rem  quit
  140. 1330 sys49161,"   [196][207] [217][207][213] [215][193][206][212] [212][207] [209][213][201][212] [212][200][201][211] [208][213][218][218][204][197]?   ",1,0,0
  141. 1340 forx=1to100:ifpeek(198)=0thennextx
  142. 1350 ifpeek(198)<>0then1410
  143. 1360 sys49161,"                                   ",4,0,0
  144. 1370 fory=1to100:ifpeek(198)=0thennexty
  145. 1380 ifpeek(198)<>0then1410
  146. 1390 goto1330
  147. 1400 :
  148. 1410 geta$
  149. 1420 ifa$<>"y"thensys49161,"                                ",4,0,0:return
  150. 1430 :
  151. 1440 sys51459:goto220
  152. 1445 :
  153. 1450 pokev+21,.
  154. 1460 poke253,na*5:poke254,2+nd*3:poke255,ni:sys51462:ag=3.34
  155. 1470 forx=1000to20000step500:sys49167,x,33,15,15:next
  156. 1480 forx=1000to20000step500:sys49167,x,33,15,15:next
  157. 1490 forx=1000to20000step500:sys49167,x,33,15,15:next
  158. 1500 sys49167,0,32,0,0
  159. 1510 fordl=1to100:nextdl
  160. 1520 :
  161. 1530 poke253,na*5:poke254,2+nd*3:poke255,ni:sys51462:ag=3.34
  162. 1540 syste,"[208][210][197][211][211] [193][206][217] [203][197][217]",14,24,.:poke198,.
  163. 1550 a=peek(203):ifa=64then1550
  164. 1560 sys51459:goto220
  165. 1590 :
  166. 1600 rem plop it
  167. 1610 ifa%(a)=nithen870
  168. 1620 t=a%(a):a%(a)=a%(bl+1):a%(bl+1)=t
  169. 1630 poke254,2+ro*3:poke253,co*5
  170. 1640 poke255,ni-1:sys51462:ag=3.34
  171. 1650 poke254,2+br*3:poke253,bc*5
  172. 1660 poke255,t-1:sys51462:ag=3.34
  173. 1670 goto610
  174. 1680 rem  game in progress
  175. 1690 gip=0:pokev+21,0
  176. 1700 print"[147]         [215][207][213][204][196] [217][207][213] [204][201][203][197] [212][207] [204][207][193][196] [193]"
  177. 1710 print"         [199][193][205][197] [201][206] [208][210][207][199][210][197][211][211]?"
  178. 1720 poke198,0:wait198,1:geta$:ifa$<>"y"then1790
  179. 1730 :
  180. 1740 f$="pp.gip"
  181. 1750 gip=1
  182. 1760 open2,8,2,f$
  183. 1770 forx=1toni:input#2,a%(x):next
  184. 1780 close2
  185. 1790 gosub7000:gosub7100:gosub6000
  186. 1795 syste,"[208]lease wait -- [208]lotting [208]icture.",4,11,.
  187. 1800 pokev+21,.:return
  188. 1970 :
  189. 1980 rem save gip
  190. 1990 rem
  191. 2000 sys49161,"      [211][193][214][201][206][199] [199][193][205][197] [201][206] [208][210][207][199][210][197][211][211]...      ",1,1,0
  192. 2010 open15,8,15,"i0":print#15,"s0:pp.gip":close15
  193. 2020 :
  194. 2030 f$="0:pp.gip,s,w"
  195. 2040 open2,8,2,f$
  196. 2050 forx=1toni
  197. 2060 print#2,a%(x)
  198. 2070 next
  199. 2080 close2
  200. 2090 sys49161,"                                     ",1,1,0
  201. 2092 sys49161,"[208][201][216][197][204] [208][213][218][218][204][197][210]",13,1,1
  202. 2100 return
  203. 3000 poke53280,14:poke53281,14
  204. 3010 syscm,55296,25576,1000:sys51459
  205. 3020 print"[147]             [208][201][216][197][204] [208][213][218][218][204][197][210]"
  206. 3030 print"    [212][207] [205][207][214][197] [212][200][197] [200][193][206][196], [213][211][197] [212][200][197] [195][213][210][211][207][210]"
  207. 3040 print"  [203][197][217][211] [207][210] [212][200][197] [202][207][217][211][212][201][195][203] ([201][206] [208][207][210][212] 2)."
  208. 3050 print"  [215][200][197][206] [212][200][197] [200][193][206][196] [201][211] [207][206] [212][200][197] [208][201][197][195][197]"
  209. 3060 print"  [217][207][213] [215][201][211][200] [212][207] [205][207][214][197], [208][210][197][211][211] [210][197][212][213][210][206] [207][210]"
  210. 3062 print"  [212][200][197] [198][201][210][197][194][213][212][212][207][206]."
  211. 3080 print"  [212][207] [211][193][214][197] [193] [199][193][205][197], [208][210][197][211][211] '[211]'"
  212. 3090 print"  [212][207] [199][197][212] [212][207] [212][200][197] [205][197][206][213], [208][210][197][211][211] '[205]'"
  213. 3092 print"  [212][20